package com.bean;

import com.bean.anno.TableExcel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Entity
@Table(name = "date_info")
@TableExcel(name="dateInfo", content = "EasyExcel日期信息",jpaBeanName="com.mapper.repository.DateInfoRepository")
public class DateInfo {

    @Id
    private String id;

    private String name;

    private String type;

    /*@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "UTC")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")*/
    //@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", timezone = "UTC")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endtime;//到期日期

    @Transient
    private String laset;//剩余时长

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createtime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatetime;

    @JsonProperty("userid")
    private String creator;

}
